package org.example.product.entity;

import java.io.Serializable;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;
import org.example.core.valid.annontation.ListValue;
import org.example.core.valid.group.AddGroup;
import org.example.core.valid.group.UpdateGroup;

/**
 * @author 小杰_cc
 * @version 1.0
 */
@Data
public class AttributeEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 属性id
	 */
	@NotNull(message = "修改时必须指定id",groups = {UpdateGroup.class})
	@Null(message = "添加时不能指定id",groups = {AddGroup.class})
	private Long id;
	/**
	 * 属性名
	 */
	@NotBlank(message = "属性名不能为空",groups = {AddGroup.class, UpdateGroup.class})
	private String name;
	/**
	 * 属性选择类型[0-单选,1-多选]
	 */
	@NotNull(message = "属性选择类型不能为空",groups = {AddGroup.class, UpdateGroup.class})
	@ListValue(value = {0,1},groups = {AddGroup.class, UpdateGroup.class})
	private Integer selectType;
	/**
	 * 属性图标
	 */
	private String icon;
	/**
	 * 属性的类型[0-规格,1-参数]
	 */
	@NotNull(message = "属性的类型不能为空",groups = {AddGroup.class, UpdateGroup.class})
	@ListValue(value = {0,1},groups = {AddGroup.class, UpdateGroup.class})
	private Integer type;
	/**
	 * 属性值多个以;隔开
	 */
	private String value;
	/**
	 * 属性状态(0-启用,1-禁用)
	 */
	@NotNull(message = "属性的状态不能为空",groups = {AddGroup.class, UpdateGroup.class})
	@ListValue(value = {0,1},groups = {AddGroup.class, UpdateGroup.class})
	private Integer status;
	/**
	 * 是否删除(0-未删除,1-删除)
	 */
	private Integer isDeleted;

}
